home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 4 / The 640 Meg Shareware Studio CD-ROM Volume IV (Data Express)(1994).ISO / clang / asyam.zip / ASYNC.DOC < prev    next >
Text File  |  1993-06-24  |  7KB  |  165 lines

  1. .   .   .   .   ########################################## .   .   .   .   .
  2.   .   .   .   . ##                                      ##   .   .   .   .
  3. .   .   .   .   ##   Async Tools for the Async Minded   ## .   .   .   .   .
  4.   .   .   .   . ##   ================================   ##   .   .   .   .
  5. .   .   .   .   ##           Scott A. Deming            ## .   .   .   .   .
  6.   .   .   .   . ##          sad@umcc.umich.edu          ##   .   .   .   .
  7. .   .   .   .   ##   No version yet, and no real name.  ## .   .   .   .   .
  8.   .   .   .   . ##                                      ##   .   .   .   .
  9. .   .   .   .   ########################################## .   .   .   .   .
  10. ============================================================================
  11.  
  12. ----------------------------------------------------------------------------
  13. SETUART.C
  14. =========
  15.  
  16. void    set_UART_port(int comport, int value);
  17. void    set_UART_int(int comport, int value);
  18. void    set_UART_onmask(int comport, int value);
  19. void    set_UART_offmask(int comport, int value);
  20.    Change defaults.  Probably not very useful, but maybe.  No return values,
  21.    because there really isn't anything significant here.  These routines
  22.    probably wont stick around too long as they seem like they will probably
  23.    just clutter the code up.
  24.  
  25. int     set_parity(int comport, int parity);
  26.    Change parity of currently open port.
  27.    Returns 1 if successful, 0 if not.
  28.  
  29. int     set_stopbits(int comport, int stopbits);
  30.    Change stop bits of currently open port.
  31.    Returns 1 if successful, 0 if not.
  32.  
  33. int     set_wordlength(int comport, int wordlength);
  34.    Change word length of currently open port.
  35.    Returns 1 if successful, 0 if not.
  36.  
  37. int     set_baudrate(int comport, long baudrate);
  38.    Change baudrate of currently open port.
  39.    Returns 1 if successful, 0 if not.
  40.  
  41. void    set_handshaking(int comport, int status);
  42.    Enable/Disable handshaking -- NOT YET IMPLEMENTED -- I NEED SOME INFO ON
  43.    THIS.  PLEASE EMAIL ME.
  44. ----------------------------------------------------------------------------
  45.  
  46. ----------------------------------------------------------------------------
  47. DETECT.C -- These routines were taken DIRECTLY from Chris Blums SERIAL port
  48. ========    Summary.
  49.  
  50. int     async_detect_uart(int comport);
  51.    Detect what type of UART is on a particular comport.  Returns UART_xxxx
  52.    which are MACRO's that can be found in ASYNC.H
  53.  
  54. int     async_detect_irq(int comport);
  55.    Detect what IRQ line is used by a particular comport.  Returns the IRQ
  56.    or -1 if it fails for some reason.
  57. ----------------------------------------------------------------------------
  58.  
  59. ----------------------------------------------------------------------------
  60. ISR.C
  61. =====
  62. void    init_ISR(int comport);
  63.    Initialize the Interrupt Service Routine for a specified comport.
  64.  
  65. void    deinit_ISR(int comport);
  66.    Remove the ISR from comport.
  67. ----------------------------------------------------------------------------
  68.  
  69. ----------------------------------------------------------------------------
  70. FIFO.C
  71. ======
  72. int     init_fifo(int comport, int enable);
  73.    Enable or Disable FIFO on the UART.  Returns 1 if successful, or 0 if not.
  74.    It does make sure you have a 16550A before continuing.  This routine will
  75.    only work on a port opened with open_port(async.c).
  76.  
  77. THIS CODE ISN'T COMPLETE YET EITHER.  I JUST HAVEN'T GOTTEN AROUND TO IT YET
  78. ----------------------------------------------------------------------------
  79.  
  80. ----------------------------------------------------------------------------
  81. ASYNC.C
  82. =======
  83. int     open_port(int comport, long baudrate, int parity, int stopbits, int wordlength);
  84.    Pretty much self explanitory.  If the port is already open, it returns a 0,
  85.    otherwise it returns 1 for a successful open.
  86.  
  87. int     close_port(int comport, int rts, int dtr);
  88.    Closes the com port.  If rts != 0 it leaves the rts line the same.  If
  89.    dtr != 0 it leaves the dtr line the same.  This is useful for programs
  90.    that exit but don't want to hang up the modem.  Returns a 0 if the port
  91.    wasn't open to begin with, or a 1 if it closes down successfuly.
  92. ----------------------------------------------------------------------------
  93.  
  94. ----------------------------------------------------------------------------
  95. LINE.C
  96. ======
  97. int     async_LCR(int comport);
  98.    Returns the value of the LCR line on comport.
  99.  
  100. int     async_MCR(int comport);
  101.    Returns the value of the MCR line on comport.
  102.  
  103. int     async_LSR(int comport);
  104.    Returns the value of the LSR line on comport.
  105.  
  106. int     async_MSR(int comport);
  107.    Returns the value of the MSR line on comport.
  108.  
  109. int     async_DTR_status(int comport);
  110.    Returns the status of DTR on comport.
  111.  
  112. int     async_RTS_status(int comport);
  113.    Returns the status of RTS on comport.
  114.  
  115. void    async_set_DTR(int comport, int status);
  116.    Sets the status of DTR on comport.
  117.  
  118. void    async_set_RTS(int comport, int status);
  119.    Sets the status of RTS on comport.
  120. ----------------------------------------------------------------------------
  121.  
  122. ----------------------------------------------------------------------------
  123. ASYIO.C
  124. =======
  125. int     async_putch_timeout(int comport, char c, long timeout);
  126.    Put a character (c) to comport, failing after timeout milliseconds
  127.    Returns 1 on success, and 0 on timeout.
  128.  
  129. void    async_putch(int comport, char c);
  130.    Put a character (c) to comport.
  131.  
  132. void    async_puts(int comport, char *s);
  133.    Put a string (s) to comport.
  134.  
  135. int     async_putblock_timeout(int comport, const char *block, int size, long timeout);
  136.    Put a block (block) of size to comport, failing after timeout milliseconds
  137.    Returns 1 on success, and 0 on timeout.
  138.  
  139. void    async_putblock(int comport, const char *block, int size);
  140.    Put a block (block) of size to comport.
  141.  
  142. int     async_ready(int comport);
  143.    Returns 1 if there is a character waiting in the RX buffer of comport,
  144.    and 0 if no character is waiting.
  145.  
  146. char    async_getch(int comport);
  147.    Returns the next character in the RX buffer of comport, removing it from
  148.    the buffer.
  149.  
  150. int     async_getblock(int comport, char *block, int size);
  151.    Pulls up to size bytes from the RX buffer of comport and puts them into
  152.    a block (block), removing them from the RX buffer.  Returns the number
  153.    of bytes actually pulled from the buffer.
  154.  
  155. char    async_peek(int comport);
  156.    Returns the next character in the RX buffer of comport, leaving it in the
  157.    buffer for later retrieval.
  158.  
  159. void    async_flushrx(int comport);
  160.    Flushes the RX buffer on comport.
  161.  
  162. void    async_flushtx(int comport);
  163.    Flushes the TX buffer on comport.
  164. ----------------------------------------------------------------------------
  165.